package ooseminar.parking;

import java.util.List;

class DefaultParkingLotChooser implements ParkingLotsChooser{
    public ParkingLots chooseParkingLots(List<ParkingLots> parkingLotsList1) {
        ParkingLots chosenParkingLots = parkingLotsList1.get(0);
        for (ParkingLots parkingLots : parkingLotsList1) {
            if (parkingLots.get(new ParkingLots.NonComericalBasedChooserRateContextAction<Integer>() {

                public Integer calculate(int size1, int idle) {
                    return idle;
                }
            }) > 0) {
                chosenParkingLots = parkingLots;
                break;
            }
        }
        return chosenParkingLots;
    }

}
